#include <stdio.h>

int main(void){

    int zippo[4][2] = { {2,4},
                        {6,8},
                        {1,3},
                        {5,7} };
    //1. zippo是一个占用2个int大小对象的地址，所以zippo与zippo+1相差8个字节
    printf("1. zippo = %p, zippo+1 = %p, zippo+2 = %p\n",zippo,zippo+1,zippo+2);

    //2. zippo[0]是一个占用1个int大小对象的地址，所以zippo[0]+1与zippo[0]相差4个字节
    printf("2. zippo[0] = %p, zippo[0]+1 = %p\n",zippo[0],zippo[0]+1);

    //3. zippo是二维数组首元素地址，zippo[0]也是二维数组首元素地址,&zippo[0][0]是二维数组首元素地址
    //在二维数组中 zippo == zippo[0] == &zippo[0][0] == *zippo
    printf("3. zippo = %p, zippo[0] = %p, &zippo[0][0] = %p, *zippo = %p\n",zippo,zippo[0],&zippo[0][0],*zippo);

    //4. *zippo 代表数组首元素（zippo[0]）的值，zippo[0]是一个占用1个int大小对象的地址
    printf("4. *zippo = %p, *zippo+1 = %p, zippo[0]+1 = %p, &zippo[0][1] = %p\n",*zippo,*zippo+1,zippo[0]+1,&zippo[0][1]);

    //5. 由4可知 **zippo == *（*zippo）==*（zippo[0]）== zippo[0][0]
    printf("5. zippo[0][0] = %d, **zippo = %d, *zippo[0] = %d\n",zippo[0][0],**zippo,*zippo[0]);

    //6. 数组可以用指针访问，ar[i] == *（ar+i），所以*（zippo+2）== zippo[2]
    printf("6. zippo+2 = %p, *(zippo+2) = %p, zippo[2] = %p, *(*(zippo+2)+1) = %d\n",zippo+2,*(zippo+2),zippo[2],* ( *(zippo+2) +1 ) );

    return 0;
}

